package cn.amebius.simpledocker.entity.po;

import cn.amebius.simpledocker.exception.DataErrorException;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * tb_user_group_relation的Po
 * @author 阿伟
 * @date 2023/7/28 18:50
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserGroupRelationPo extends BasePo{

    private Integer userId;

    private Integer groupId;
    public static void check(UserGroupRelationPo ugrp) {
        if (ugrp == null || ugrp.userId.toString().isEmpty() || ugrp.groupId.toString().isEmpty()) {
            throw new DataErrorException("数据异常:用户小组丢失");
        }
        BasePo.check(ugrp);
    }
}
